projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb44bea
)
[Mini-OS] Optimize get_current()
author
Keir Fraser
<keir.fraser@citrix.com>
Fri, 23 Nov 2007 16:23:03 +0000
(16:23 +0000)
committer
Keir Fraser
<keir.fraser@citrix.com>
Fri, 23 Nov 2007 16:23:03 +0000
(16:23 +0000)
Let gcc perform the computation with SP itself, leading to yet better
code.
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
extras/mini-os/include/x86/arch_sched.h
patch
|
blob
|
history
diff --git
a/extras/mini-os/include/x86/arch_sched.h
b/extras/mini-os/include/x86/arch_sched.h
index 6bc47f89d36e954d88539d2327c9e4e9439e7046..7bf0036fac54ee5fab55597830dc25222730fd70 100644
(file)
--- a/
extras/mini-os/include/x86/arch_sched.h
+++ b/
extras/mini-os/include/x86/arch_sched.h
@@
-7,10
+7,11
@@
static inline struct thread* get_current(void)
{
struct thread **current;
#ifdef __i386__
-
__asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL)
);
+
register unsigned long sp asm("esp"
);
#else
-
__asm__("andq %%rsp,%0; ":"=r" (current) : "0" (~8191UL)
);
+
register unsigned long sp asm("rsp"
);
#endif
+ current = (void *)(sp & ~8191UL);
return *current;
}